<?php
class Zend_View_Helper_UserLocation extends Zend_View_Helper_Abstract {
	
    public $view;
    
    public function setView(Zend_View_Interface $view) {
        $this->view = $view;
    }
    
	public function userLocation($user) {
		$regionId = User::getCity($user)->id;
		$regionName = User::getCity($user)->name;
		$cityId = City::getTopCity($regionId)->id;
		$cityName = City::getTopCity($regionId)->name;
		$countryName = City::getCountry($cityId)->name;
		
		if ($regionId == $cityId)
			return $cityName.", ".$countryName;
		else
			return $regionName." ".$cityName.", ".$countryName;
	}
}
?>